/*
 * @Description: 管道流
 * @Author: dh
 * @Date: 2021-09-02 17:25:56
 * @LastEditors: dh
 * @LastEditTime: 2023-12-26 09:27:21
 */
'use strict'

var fs = require('fs')
var path = require('path')

var rs = fs.createReadStream(path.join(__dirname, './origin.txt'))
var ws = fs.createWriteStream(path.join(__dirname, './test.txt'))

rs.on('end', function () {
	console.log('读取完毕')
})

ws.on('close', () => {
	console.log('写入完毕')
})

rs.pipe(ws)
